﻿package org.nickro.externallibrary.display {
    import flash.events.*;
    import flash.display.*;
    import flash.geom.*;
    import flash.utils.*;

    public class PSLCoreSprite extends Sprite implements IPSLCoreSprite {

        public static const ALIGN_CENTER:String = "center";

        private var _isEnabled:Boolean;

        public function PSLCoreSprite(){
            addEventListener(Event.ADDED_TO_STAGE, this.onAddedToStage, false, 0, true);
            addEventListener(Event.REMOVED_FROM_STAGE, this.onRemovedFromStage, false, 0, true);
        }
        public function onAddedToStage(_arg1:Event):void{
        }
        public function onRemovedFromStage(_arg1:Event):void{
        }
        public function get isInteractive():Boolean{
            return (buttonMode);
        }
        public function set isInteractive(_arg1:Boolean):void{
            buttonMode = _arg1;
            useHandCursor = _arg1;
            mouseChildren = (tabChildren = !(_arg1));
        }
        public function removeChildren():void{
            while (numChildren > 0) {
                removeChildAt(0);
            };
        }
        public function destroy():void{
            removeEventListener(Event.ADDED_TO_STAGE, this.onAddedToStage);
            removeEventListener(Event.REMOVED_FROM_STAGE, this.onRemovedFromStage);
        }
        override public function toString():String{
            return (getQualifiedClassName(this));
        }
        public function move(_arg1:Number, _arg2:Number):void{
            x = _arg1;
            y = _arg2;
        }
        public function set autoAlpha(_arg1:Boolean):void{
            visible = _arg1;
            alpha = (_arg1) ? 1 : 0;
        }
        public function get isEnabled():Boolean{
            return (this._isEnabled);
        }
        public function set isEnabled(_arg1:Boolean):void{
            this._isEnabled = _arg1;
        }
        public function get scale():Number{
            return (((scaleX)>=scaleY) ? scaleX : scaleY);
        }
        public function set scale(_arg1:Number):void{
            scaleX = (scaleY = _arg1);
        }
        public function align(_arg1:String=null, _arg2:Number=NaN, _arg3:Number=NaN):void{
            var _local4:Rectangle;
            switch (_arg1){
                case PSLCoreSprite.ALIGN_CENTER:
                    if (isNaN(_arg2)){
                        _arg2 = stage.stageWidth;
                    };
                    _local4 = super.getRect(this);
                    if (isNaN(_arg3)){
                        _arg3 = _local4.width;
                    };
                    x = Math.round((((_arg2 - _arg3) - _local4.x) / 2));
                    break;
            };
        }

    }
}//package org.nickro.externallibrary.display 
